load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "heap",
    srcs = ["heap.go"],
    importpath = "github.com/pingcap/tidb/pkg/statistics/handle/autoanalyze/internal/heap",
    visibility = ["//pkg/statistics/handle/autoanalyze:__subpackages__"],
    deps = ["@com_github_pingcap_errors//:errors"],
)

go_test(
    name = "heap_test",
    timeout = "short",
    srcs = [
        "heap_test.go",
        "main_test.go",
    ],
    embed = [":heap"],
    flaky = True,
    shard_count = 14,
    deps = [
        "//pkg/testkit/testsetup",
        "@com_github_stretchr_testify//require",
        "@org_uber_go_goleak//:goleak",
    ],
)
